home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #10 / Commodore_Disk_User_Vol.4_10_1991_-.d64 / memory game (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1991-01-01  |  3.7 KB  |  134 lines

  1. 1 ifa=0thena=1:load"seq.m/c",8,1
  2. 2 ifa=1thena=2:load"note.m/c",8,1
  3. 3 ifa=2thena=3:load"music.m/c",8,1
  4. 4 ifa=4thensys49239:ty=1:goto52
  5. 10 poke53280,15:poke53281,15:print"[147][151]"
  6. 40 poke53272,(peek(53272)and240)+12
  7. 45 print"[147]"
  8. 50 ifa=3thena=4:load"memory ii",8,1
  9. 52 v=53248:pokev+21,0:pokev+27,0:gosub1000
  10. 54 dimp(11,11),h(121),v(121)
  11. 55 print"[147]":pl=1
  12. 60 print" [176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  13. 70 fort=1to10
  14. 80 print" [221] [221] [221] [221] [221] [221] [221][160][221][160][221][160][221][160][221][160][221]              [221]"
  15. 90 print" [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]              [221]"
  16. 100 nextt
  17. 110 print" [221] [221] [221] [221] [221] [221] [221][160][221][160][221][160][221][160][221][160][221]              [221]"
  18. 120 print" [173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  19. 125 c$=""
  20. 127 gosub130
  21. 129 goto210
  22. 130 print""c$"memory"
  23. 140 printc$"[183][183][183][183][183][183]"
  24. 142 printc$"by"
  25. 145 printc$"robert"
  26. 147 printc$"nielsen!"
  27. 149 printc$"(c) 1990"
  28. 150 printc$"[157][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
  29. 155 printc$"scores are"
  30. 160 printc$""p$(1)":"s(1)
  31. 170 printc$""p$(2)":"s(2)
  32. 180 printc$"[157][219][192][192][174]    [176][192][192][192][192][192][192][179]"
  33. 190 printc$pl"[157][221]    [221]dragon"
  34. 200 printc$"[177][177]"
  35. 201 print"[166]"
  36. 205 return
  37. 210 data0,127,255,0,63,255,0,31,255,0,15,255,0,7,255,0,3,255,0,1,255,0,3,255,0,7
  38. 220 data255,0,15,191,0,31,31,0,62,15,0,124,7,0,248,3,1,240,1,3,224,0,7,192,0,15
  39. 230 data128,0,31,0,0,14,0,0,4,0,0
  40. 240 restore:forn=0to62:readb:poke9920+n,b:nextn
  41. 245 v=53248
  42. 250 poke2040,155:pokev,20:pokev+1,70:pokev+39,1:pokev+21,1
  43. 252 forgh=1to11:forhg=1to11:p(gh,hg)=0:nexthg:nextgh
  44. 255 f=59:fl=1:p(1,1)=42
  45. 260 fort=1to120:fl=fl+1:iffl=4thenfl=0:f=f+1
  46. 270 iff=64thenf=97
  47. 280 iff=123then300
  48. 285 x=int(rnd(0)*11)+1:y=int(rnd(0)*11)+1
  49. 287 ifp(x,y)<>0then285
  50. 290 p(x,y)=f:h(t)=x:v(t)=y
  51. 295 print"";-t+120;"[157]   ":nextt:print"    "
  52. 300 j=15-(peek(56320)and15)
  53. 310 ifj=1andpeek(v+1)>70thenpokev+1,peek(v+1)-16
  54. 320 ifj=2andpeek(v+1)<230thenpokev+1,peek(v+1)+16
  55. 330 ifj=4andpeek(v)>20thenpokev,peek(v)-16
  56. 340 ifj=8andpeek(v)<180thenpokev,peek(v)+16
  57. 350 if(peek(56320)and16)=0then370
  58. 355 geta$:ifa$="[133]"then700
  59. 356 ifa$="q"then480
  60. 357 ifa$="m"andty=1thensys49209:ty=0:goto300
  61. 358 ifa$="m"andty=0thensys49239:ty=1
  62. 360 goto300
  63. 370 h1(po)=((peek(v)-20)/16)*2+2:v1(po)=((peek(v+1)-70)/16)*2+2
  64. 375 h2(po)=(peek(v)-20)/16+1:v2(po)=(peek(v+1)-70)/16+1
  65. 376 ifp(h2(po),v2(po))=42then300
  66. 380 print"";:fort=1toh1(po):print"";:nextt:fort=1tov1(po):print"";:nextt
  67. 385 print"[129]";chr$(p(h2(po),v2(po)))"[151]"
  68. 386 ifpo=1thencq=p(h2(1),v2(1)):goto400
  69. 387 cv=p(h2(0),v2(0))
  70. 390 pokev+39,12:po=1
  71. 395 goto300
  72. 400 ifcq=cvandv2(0)<>v2(1)then430
  73. 402 ifcq=cvandh2(0)<>h2(1)then430
  74. 403 ifcq=cvthenpo=1:goto300
  75. 404 forg=1to500:nextg
  76. 405 form=0to1
  77. 410 print"";:fort=1toh1(m):print"";:nextt:fort=1tov1(m):print"";:nextt:print" "
  78. 420 nextm:pokev+39,1:po=0
  79. 425 ifpl=1thenpl=2:goto428
  80. 426 ifpl=2thenpl=1
  81. 428 gosub130:goto300
  82. 430 fort=1to128:poke53280,peek(53280)-240+t:nextt:s(pl)=s(pl)+10
  83. 440 ifcq=122thens(pl)=s(pl)+10
  84. 445 ifcq=59thens(pl)=s(pl)+20
  85. 450 gosub130:pokev+39,1:po=0
  86. 454 forr=0to1
  87. 455 print"";:fort=1toh1(r):print"";:nextt:fort=1tov1(r):print"";:nextt
  88. 456 printchr$(p(h2(r),v2(r))):nextr
  89. 460 p(h2(0),v2(0))=42:p(h2(1),v2(1))=42
  90. 470 fort=1to11:form=1to11:ifp(t,m)<>42then300
  91. 475 nextm:nextt
  92. 480 pokev+21,0
  93. 490 print"[147]"
  94. 500 printspc(17)"memory"
  95. 510 printspc(17)"[183][183][183][183][183][183]"
  96. 520 print"   the game has finished and the"
  97. 530 print"   winner is ......."
  98. 540 ifs(2)>s(1)then560
  99. 550 print"   "p$(1)"!!!!!!!!!":wi(1)=w(1)+1
  100. 555 print"   with"s(1)" points.":goto570
  101. 560 print"   "p$(2)"!!!!!!!!!":wi(2)=w(2)+1
  102. 565 print"   with"s(2)" points."
  103. 570 print"   another game?(y/n)"
  104. 580 geta$:ifa$=""then580
  105. 590 ifa$="y"thenrun52
  106. 600 ifa$="n"thenprint"[147]bye bye.":sys49209:end
  107. 610 goto580
  108. 700 ifpeek(v+27)=0thenpokev+27,1:goto300
  109. 710 pokev+27,0:goto300
  110. 998 print"[145][145][145][145][145][145][145][145][145][145]"
  111. 999 goto999
  112. 1000 print"[147]"
  113. 1010 printspc(17)"memory"
  114. 1020 printspc(17)"[183][183][183][183][183][183]"
  115. 1030 print"   this is a game of memory.  use"
  116. 1040 print"   the joystick in port 2 to select"
  117. 1050 print"   a square by pressing fire, moving"
  118. 1060 print"   to another square and pressing"
  119. 1070 print"   fire again.  if the two symbols"
  120. 1080 print"   symbols match you win 10 points."
  121. 1090 print"   if the symbols are '[218]' you get"
  122. 1100 print"   20 points and if they are ';' you"
  123. 1110 print"   get 30 points. game ends when all"
  124. 1120 print"   the squares have been uncovered"
  125. 1122 print"   or 'q' (quit) is pressed.
  126. 1125 [153]"   'f1' may be pressed to change back-"
  127. 1127 [153]"   ground priority and 'm' for music."
  128. 1130 [153]"   please enter your names now."
  129. 1140 [133]"   player 1:";p$(1)
  130. 1150 [139][195](p$(1))[177]11[167][153]"onon":[137]1140
  131. 1160 [133]"   player 2:";p$(2)
  132. 1170 [139][195](p$(2))[177]11[167][153]"onon":[137]1160
  133. 1180 [142]
  134.